package com.xmotor.test_multiple_implements;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author Dang Xianyue
 * @Date 2020-09-09 19:42
 * @Version 1.0
 */
@RestController
@RequestMapping("/testmi")
public class TestMultipleImplementsController {
    @Autowired
    private TestService testService;

    @Autowired
    @Qualifier(value = "adapterImplA")
    private Adapter adapter1;

    @Autowired
    @Qualifier(value = "adapterImplB")
    private Adapter adapter2;

    @RequestMapping("/test1")
    public void test() throws Exception{
        testService.say();
    }

    @RequestMapping("/test2")
    public void test2() throws Exception{
        adapter1.doSomething();
    }

    @RequestMapping("/test3")
    public void test3() throws Exception{
        adapter2.doSomething();
    }
}
